import { usePost } from "@/utils/http"
import { md5 } from "js-md5"

interface LoginParam {
    username: string
    password: string
}
export function login(params: LoginParam) {
    params.password = md5(params.password)
    return usePost("/oauth/login", params)
}

export function checkLogin() {
    return usePost("/oauth/checkLogin", {})
}

export function logout() {
    return usePost("/oauth/logout", {})
}

export const api = { login, checkLogin, logout }
